﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThanhTu.GNC.Media.KQXS.DataAccess.DAL;
using ThanhTu.GNC.Media.KQXS.DataAccess.DO;

namespace ThanhTu.GNC.Media.KQXS.DataAccess.BL
{
    public class SenderMessageBL : IDisposable
    {
        private SenderMessageDAL vSenderMessageDAL = null;
        private bool disposed = false;
        public SenderMessageBL()
        {
            if (vSenderMessageDAL == null)
            {
                vSenderMessageDAL = new SenderMessageDAL();
            }
        }
        ~SenderMessageBL() { Dispose(false); }

        #region IDisposable Members

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (vSenderMessageDAL != null)
                    {
                        vSenderMessageDAL.Dispose();
                        vSenderMessageDAL = null;
                    }
                }

                disposed = true;
            }
        }

        #endregion

        public int SaveSenderMessage(SenderMessageDO vSenderMessageDO) { return vSenderMessageDAL.SaveSenderMessage(vSenderMessageDO); }
        public SenderMessageDO GetBySenderMessage(string phone, string provinceid, string switchboard) { return vSenderMessageDAL.GetBySenderMessage(phone, provinceid, switchboard); }
        public List<SenderMessageDO> SelectAll() { return vSenderMessageDAL.SelectAll(); }
    }
}
